package com.mspbots.core.teams.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mspbots.core.DefaultBaseService;
import com.mspbots.core.teams.model.BotMessageCacheDTO;
import com.mspbots.core.teams.model.Messages;
import com.mspbots.core.teams.model.MessagesIncontrollable;
import com.mspbots.cw.request.MessagesDTO;
import com.mspbots.cw.request.TriggerEscalationDTO;
import com.mspbots.dto.statistics.MessagesStatisticDTO;
import com.mspbots.dto.statistics.MessagesStatisticUserDTO;

import java.util.List;


public interface MessagesService extends DefaultBaseService<Messages> {

    /**
     * TODO
     *
     * @param query
     * @return int
     * @author Jun Zhou
     * @date 14:54 2019/7/2
     **/
    int countMessagesByForRule(Messages query);

    int countEscalation(Messages query);

    /**
     * TODO
     *
     * @param query
     * @return java.util.List<com.mspbots.core.model.Messages>
     * @author Jun Zhou
     * @date 14:54 2019/7/2
     **/
    List<Messages> listSend(Messages query);

    /**
     * @param entryId
     * @return
     */
    List<MessagesDTO> findByTimeEntryId(Long entryId);

    List<MessagesStatisticDTO> countByType(Long tenantId);

    List<MessagesStatisticDTO> countByDay(MessagesStatisticDTO messagesStatisticDTO);

    IPage<MessagesDTO> reportPage(Page page, MessagesDTO query);

    int countByGroupUser(Long tenantId);

    TriggerEscalationDTO triggerEscalationList(TriggerEscalationDTO query);

    Page<MessagesStatisticUserDTO> countByDayUser(Page<MessagesStatisticUserDTO> page, MessagesStatisticUserDTO messagesStatisticUserDTO);

    Object insertMessages(Messages entity);

    List<MessagesIncontrollable> incontrollable(MessagesIncontrollable params);

    Object cacheMsgCount(BotMessageCacheDTO query);

    Object getCacheMsgCount(BotMessageCacheDTO query);

    Object countTimeEntryBot(BotMessageCacheDTO query);

    boolean removeCache(Long userId);
}
